package cn.wecloud.im.multiplayervideodemo.handler

import android.content.Context
import cn.wecloud.im.core.im.IMConversation
import cn.wecloud.im.core.im.IMMultiMeetHandler
import cn.wecloud.im.core.im.messages.MultiMeetEvent
import cn.wecloud.im.multiplayervideodemo.App
import cn.wecloud.im.multiplayervideodemo.act.MeetAnswerActivity

class MultiMeetMsgHandler(val appContent: Context) : IMMultiMeetHandler() {

    override fun processMultiMeetCallEvent(conversation: IMConversation?, data: MultiMeetEvent?) {
        super.processMultiMeetCallEvent(conversation, data)
        if (data == null)
            return
        //防止重复启动,中途发起邀请也会回调此方法
        if (!App.instance.isMultipleVideo()) {
            MeetAnswerActivity.startAnswer(
                appContent,
                data.conversationId,
                data.roomId,
                data.clientId,
                data.memberDtoList
            )
        }
    }

}